# -*- coding: utf-8 -*-
# @Time    : 2024/8/29 20:02
# @Author  : qd
# @Email   : 1518603573@qq.com
# @File    : login_page.py
# @Software: PyCharm
from selenium.webdriver.common.by import By
from pages.wb_base_page import BasePage
class LoginPage(BasePage):
    url = "/crm/index.php?m=user&a=login"
    username_locator = (By.NAME, "name")
    password_locator = (By.NAME, "password")
    login_locator = (By.CSS_SELECTOR, "body > div.container > div > div.span4 > div > form > fieldset > input.btn.btn-primary")
    """输入用户名"""
    def input_username(self,username):
        self.driver.find_element(*self.username_locator).send_keys(username)
    """输入密码"""
    def input_password(self,password):
        self.driver.find_element(*self.password_locator).send_keys(password)
    """点击登录"""
    def click_login(self):
        self.driver.find_element(*self.login_locator).click()